
<script>
   
    var UNIQUEIDENTIFIER = '<?php echo $this->UNIQUEIDENTIFIER; ?>';



</script>
<?php $this->headScript()->appendFile($this->JS_PATH . 'form_member.js'); ?>
<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
<div class="clearfix"></div>
<div class="content">
    <div class="page-title"> <i class="icon-custom-right"></i>
        <h3><span class="semi-bold">Add member</span></h3>
    </div>
    <div class="row">

        <div class="col-md-12">
            <div class="grid simple">
                <div class="grid-title">


                </div>
                <div class="grid-body ">
                    <div class="row">


                        <?php if (count($this->errorMessageArray) > 0): ?>
                            <div class="alert alert-error">
                                <?php foreach ($this->errorMessageArray as $erroValue): ?>

                                    <div class="text-left">
                                        <i class="icon-remove-sign"></i>
                                        <?php echo $erroValue; ?>
                                    </div>

                                <?php endforeach; ?>
                            </div>
                        <?php endif; ?>

                        <form id="commentForm" action="" method="POST" enctype="multipart/form-data">
                            <div class="">
                                <ul id="tab-01" class="nav nav-tabs">
                                    <li class="active"><a href="#tab1Profile">Profile</a></li>
                                    <?php if($this->mode=='Edit'):?>
                                    <li class="dropdown"> <a href="#" data-toggle="dropdown" class="dropdown-toggle"> Properties  <b class="caret"></b> </a>
                                        <ul class="dropdown-menu">
                                            <li><a href="javascript:void(0)">Saved Properties</a></li>
                                            <li><a href="javascript:void(0)">Viewed Properties</a></li>
                                            <li><a href="javascript:void(0)">Properties For Sale</a></li>
                                            <li><a href="javascript:void(0)">Properties For Rent</a></li>
                                            
                                        </ul>
                                    </li>
                                    <li class=""><a href="javascript:void(0)">Alerts & Searches</a></li>
                                    <li class=""><a href="#tab1notes">Notes</a></li>
                                    <li class=""><a href="#tab1Files">Files </a></li>
                                    <?php endif;?>
                                    
                                </ul>
                                <div class="tools"> <a class="collapse" href="javascript:;"></a> <a class="config" data-toggle="modal" href="#grid-config"></a> <a class="reload" href="javascript:;"></a> <a class="remove" href="javascript:;"></a> </div>
                                <div class="tab-content">
                                    
                                    
                                    <!--- Tabs for Profile --->
                                    <div id="tab1Profile" class="tab-pane active">
                                    <input type="hidden" name="UNIQUEIDENTIFIER" value="<?php echo $this->UNIQUEIDENTIFIER; ?>" />
                                    <div class="row form-row">
                                        <div class="col-md-6">
                                            <label class="form-label">Prefix
                                            
                                            </label>
                                            <?php echo $this->form->mem_prefix; ?>
                                        </div>
                                        <div class="col-md-6">
                                                <label class="form-label">Name</label>
                                        <?php echo $this->form->mem_name; ?>
                                            </div>
                                        
                                       
                                        </div>
                                       
                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label class="form-label">Surname</label>
                                                <?php echo $this->form->mem_surname; ?>
                                            </div>
                                            <div class="col-md-6">
                                            <label class="form-label">Email</label>
                                            <?php echo $this->form->member_email; ?>
                                             </div>
                                        </div>
                                    
                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label class="form-label">Password</label>
                                                <?php echo $this->form->member_password; ?>
                                            </div>
                                        </div>
                                    
                                        <div class="row form-row">
                                            
                                             <div class="col-md-6">
                                                <label class="form-label">Phone</label>
                                            <?php echo $this->form->member_phone; ?>
                                            </div>
                                            
                                            <div class="col-md-6">
                                                <label class="form-label">DOB</label>
                                            <?php echo $this->form->mem_bday; ?>
                                            </div>
                                            
                                           
                                           
                                        </div>
                                    
                                    
                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label class="form-label">Company Name</label>
                                                <?php echo $this->form->mem_company_name; ?>
                                            </div>
                                             <div class="col-md-6">
                                            <label class="form-label">Company Type</label>
                                            <?php echo $this->form->mem_company_type; ?>
                                             </div>
                                        </div>
                                    
                                    

                                       

                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label class="form-label">Mobile</label>
                                        <?php echo $this->form->mem_mobile; ?>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-label">Home</label>
                                        <?php echo $this->form->mem_landline; ?>
                                            </div>
                                           
                                        </div>


                                        <div class="row form-row">
                                             <div class="col-md-6">
                                                <label class="form-label">Work</label>
                                        <?php echo $this->form->mem_work; ?>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-label">Fax</label>
                                                <?php echo $this->form->mem_fax; ?>
                                            </div>
                                        </div>
                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label class="form-label">Country</label>
                                        <?php echo $this->form->mem_country; ?>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-label">City</label>
                                        <?php echo $this->form->mem_city; ?>
                                            </div>
                                        </div>
                                        <br/>
                                         <div class="row form-row">
                                            <div class="col-md-12">
                                                <label class="form-label">Address</label>
                                        <?php echo $this->form->mem_address; ?>
                                            </div>
                                         </div>
                                        <br/>
                                        <input type="hidden" value="<?php echo $this->show_client_status?>" name="show_client_status" id="show_client_status" >
                                        <input type="hidden" value="<?php echo $this->show_client_datepicker?>" name="show_client_datepicker" id="show_client_datepicker">
                                          
                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label class="form-label">Referral Name</label>
                                                <?php echo $this->form->client_referral_name; ?>
                                            </div>
                                            
                                         </div>
                                        
                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label class="form-label">User Type</label>
                                                <?php
                                                //$this->form->mem_client_type; ?>
                                                <?php 
                                               
                                                foreach($this->clientTypeData as $key =>$value):
                                                    $dataArray = array();
                                                    if($this->mode == 'Edit'):
                                                        $dataArray = $this->member_usertype;
                                                    else:
                                                        if($this->member_usertype != ''):
                                                            $dataArray = array_flip($this->member_usertype);
                                                        endif;
                                                    endif;
                                                        if(array_key_exists($key,$dataArray)){
                                                            $checked = "checked";
                                                        }else{
                                                            $checked = "";
                                                        }
                                                   if($key == 'buyer' || $key == 'tenant'):
                                                       $class_name = "class='mem_client_type'";
                                                   else:
                                                        $class_name = "";
                                                   endif;
                                                ?>
                                                <div class="col-md-4">
                                                 <label for="user_type_<?php echo $key;?>"> 
                                                    <input <?php echo $class_name;?>  <?php echo $checked;?> type="checkbox" name="mem_client_type[]" id="user_type_<?php echo $key;?>" value="<?php echo $key;?>">
                                                <?php echo $value;?>
                                                </label>
                                                </div>
                                                <?php
                                                endforeach;
                                                ?>
                                            </div>
                                            
                                            <div class="col-md-6 client_status display-none">
                                                <label class="form-label">Client Status</label>
                                                <?php echo $this->form->mem_client_status; ?>
                                            </div>
                                         </div>
                                        
                                        <br/>
                                         <div class="row form-row">
                                            <div class="col-md-6 client_datepicker display-none">
                                                <label class="form-label">Calendar</label>
                                                
                                                <?php echo $this->form->mem_client_calender; ?>
                                            </div>
                                             <div class="col-md-6 client_note display-none ">
                                                <label class="form-label">Note</label>
                                                <?php echo $this->form->mem_client_note; ?>
                                            </div>
                                         </div>
                                        
                                        <div class="row form-row">
                                            <div class="col-md-6">
                                                <label for="member_admin"> 
                                                <input type="checkbox" name="member_admin" 
                                                 <?php if($this->member_admin == 1): echo "checked";endif;?>
                                                       id="member_admin" value="1">
                                                
                                                    Register as a Admin?
                                                </label>
                                            </div>
                                         </div>
                                        
                                        
                                        <h4>Representative Details</h4>  <br/>
                                        <div class="panel-group" id="accordion">
                                            <div class="panel panel-default">
                                                <div class="panel-heading collapsed"> <h4 class="panel-title">
                                                        <a class="collapsed item-class" data-toggle="collapse" data-parent="#accordion" href="#collapse1">
                                                            Representative 1
                                                        </a>
                                                    </h4>
                                                </div>
                                                
                                                 <div id="collapse1" class="panel-collapse collapse  item-container">
                                                     <div class="panel-body">
                                                         <div class="row form-row">
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Name</label>
                                                                 <?php echo $this->form->mem_representative_name1; ?>
                                                             </div>
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Telephone</label>
                                                                 <?php echo $this->form->mem_representative_telephone1; ?>
                                                             </div>
                                                         </div>
                                                         
                                                         <div class="row form-row">
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Email</label>
                                                                 <?php echo $this->form->mem_representative_email1; ?>
                                                             </div>
                                                             
                                                         </div>
                                                         
                                                     </div>
                                                 </div>
                                            </div>
                                            
                                        </div>
                                        <div class="panel-group" id="accordion">
                                            <div class="panel panel-default">
                                                <div class="panel-heading collapsed"> <h4 class="panel-title">
                                                        <a class="collapsed item-class" data-toggle="collapse" data-parent="#accordion" href="#collapse2">
                                                            Representative 2
                                                        </a>
                                                    </h4>
                                                </div>
                                                
                                                 <div id="collapse2" class="panel-collapse collapse  item-container">
                                                     <div class="panel-body">
                                                         <div class="row form-row">
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Name</label>
                                                                 <?php echo $this->form->mem_representative_name2; ?>
                                                             </div>
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Telephone</label>
                                                                 <?php echo $this->form->mem_representative_telephone2; ?>
                                                             </div>
                                                         </div>
                                                         
                                                         <div class="row form-row">
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Email</label>
                                                                 <?php echo $this->form->mem_representative_email2; ?>
                                                             </div>
                                                             
                                                         </div>
                                                         
                                                     </div>
                                                 </div>
                                            </div>
                                            
                                        </div>
                                        <div class="panel-group" id="accordion">
                                            <div class="panel panel-default">
                                                <div class="panel-heading collapsed"> <h4 class="panel-title">
                                                        <a class="collapsed item-class" data-toggle="collapse" data-parent="#accordion" href="#collapse3">
                                                            Representative 3 
                                                        </a>
                                                    </h4>
                                                </div>
                                                
                                                 <div id="collapse3" class="panel-collapse collapse  item-container">
                                                     <div class="panel-body">
                                                         <div class="row form-row">
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Name</label>
                                                                 <?php echo $this->form->mem_representative_name3; ?>
                                                             </div>
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Telephone</label>
                                                                 <?php echo $this->form->mem_representative_telephone3; ?>
                                                             </div>
                                                         </div>
                                                         
                                                         <div class="row form-row">
                                                             <div class="col-md-6">
                                                                 <label class="form-label">Representative Email</label>
                                                                 <?php echo $this->form->mem_representative_email3; ?>
                                                             </div>
                                                             
                                                         </div>
                                                         
                                                     </div>
                                                 </div>
                                            </div>
                                            
                                        </div>
                                      
                                        <div class="col-md-6">
                                            <?php if ($this->mode == 'Add'): ?>
                                            <input type="submit" value="Add Member" class="submitfrmbtn   btn btn-primary" name="Add Member"/>
                                        <?php endif; ?>
                                        </div>
                                        
                                    </div>
                                    
                                    <div id="saved_property" class="tab-pane ">
                                    saved_property
                                    </div>
                                    
                                    <div id="viewed_property" class="tab-pane ">
                                    viewed_property
                                    </div>
                                    
                                    <div id="sale_property" class="tab-pane ">
                                    sale_property
                                    </div>
                                    
                                    <div id="rent_property" class="tab-pane ">
                                    rent_property
                                    </div>
                                    
                                    <div id="tab1alerts" class="tab-pane ">
                                    tab1alerts
                                    </div>
                                    
                                    
                                    <!--- Tabs for notes --->
                                    <div id="tab1notes" class="tab-pane ">
                                    <div class="row column-seperation" style="margin-left:-25px;">
                                        <div class="col-md-12">
                                            <textarea cols="60" rows="10" class="form-control wysihtml5-editor" name="mem_description">
                                                <?php echo $this->mem_description;?>
                                            </textarea>
                                        </div>
                                    </div>
                                    </div>
                                    <!--- Tabs for Upload Document --->
                                    <div id="tab1Files" class="tab-pane ">
                                         
                                        <div class="mainimage-container">
                                            <h4>Profile Image</h4>            
                                            <div class="row form-row">
                                                <div class="col-md-4">
                                                    <input name="profile_image" class="image_class" type="file" />
                                                </div>
                                            </div>		


                                            <?php if ($this->profile_image != ""): ?>
                                                <div class="row form-row">
                                                    <div class="col-md-3">
                                                        <?php
                                                        $src_path = $this->PUBLIC_PATH . "upload/member/profile/" . $this->profile_image;
                                                        ?>
                                                        <img src="<?php echo $src_path; ?>" height="100" width="100"/>
                                                    </div>
                                                </div>		
                                            <?php endif; ?>

                                        </div>
                                        
                                        <div class="documents-wrappercontainer">
                                            <h4>Upload Documents</h4>            
                                            <div class="row form-row documentcontainer">
                                                <div class="col-md-10">
                                                    <div class="dropzone document_dropzone">
                                                    </div>
                                                </div>
                                            </div>	
                                            <br/>
                                            <?php 
                                            if($this->mode == 'Edit'):
                                             if (array_key_exists('DOCUMENT', $this->memberDocuments)):                                                
                                            foreach ($this->memberDocuments['DOCUMENT'] as $_img): ?>
                                                <?php if ($_img['memd_doc'] != ""): ?>
                                                    <div class="row form-row">
                                                        <div class="col-md-5">
                                                            <?php
                                      
                                                            $src_path = $this->PUBLIC_PATH . "img/document.png";
                                                            ?>
                                                            <img src="<?php echo $src_path; ?>" height="100" width="100"/>
                                                            <a href="<?php echo $this->url(array('controller' => 'member', 'action' => 'deleteimage', 'type' => 'DOCUMENT', 'id' => $_img['memd_id']), 'default', false); ?>" class="btn btn-danger">Delete</a>
                                                            <a href="<?php echo $this->PUBLIC_PATH."upload/member/document/".$_img['memd_doc'];?>" target="_blank" class="btn btn-danger">View</a>
                                                        </div>
                                                    </div>		
                                                    <br/>
                                                <?php endif; ?>
                                            <?php endforeach;
                                            endif;
                                            endif;
                                            ?>
                                        </div>
                                        <br>
                                        <div class="col-md-6">
                                            <?php if ($this->mode == 'Edit'): ?>
                                            <input type="submit" value="Edit Member" class="submitfrmbtn btn btn-primary" name="Edit Member"/>
                                            <?php endif; ?>
                                        </div>
                                       
                                    </div>
                                   
                                   
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- END PAGE -->